package com.nbsaas.boot.merchant.rest.resource;

import com.nbsaas.boot.merchant.api.apis.MerchantLogApi;
import com.nbsaas.boot.merchant.data.entity.MerchantLog;
import com.nbsaas.boot.merchant.api.domain.request.MerchantLogRequest;
import com.nbsaas.boot.merchant.api.domain.response.MerchantLogResponse;
import com.nbsaas.boot.merchant.api.domain.simple.MerchantLogSimple;
import com.nbsaas.boot.merchant.rest.convert.MerchantLogSimpleConvert;
import com.nbsaas.boot.merchant.rest.convert.MerchantLogEntityConvert;
import com.nbsaas.boot.merchant.rest.convert.MerchantLogResponseConvert;
import com.nbsaas.boot.merchant.data.repository.MerchantLogRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   商家操作日志-业务接口实现
*/
@Transactional
@Service
public class MerchantLogResource extends BaseResource<MerchantLog,MerchantLogResponse, MerchantLogSimple, MerchantLogRequest>  implements MerchantLogApi {

    @Resource
    private MerchantLogRepository merchantLogRepository;

    @Override
    public JpaRepositoryImplementation<MerchantLog, Serializable> getJpaRepository() {
        return merchantLogRepository;
    }

    @Override
    public Function<MerchantLog, MerchantLogSimple> getConvertSimple() {
        return new MerchantLogSimpleConvert();
    }

    @Override
    public Function<MerchantLogRequest, MerchantLog> getConvertForm() {
        return new MerchantLogEntityConvert();
    }

    @Override
    public Function<MerchantLog, MerchantLogResponse> getConvertResponse() {
        return new MerchantLogResponseConvert();
    }




}


